package com.provider.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.provider.dao.TTaskDao;
import com.provider.entity.TTask;
import com.provider.service.TTaskService;
import org.springframework.scheduling.config.Task;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 项目Task任务(TTask)表服务实现类
 *
 * @author makejava
 * @since 2024-04-28 12:55:49
 */
@Service("tTaskService")
@Transactional(rollbackFor = Exception.class)
public class TTaskServiceImpl extends ServiceImpl<TTaskDao, TTask> implements TTaskService {

    @Override
    public List<TTask> queryTaskBySystemId(String systemId) {
        LambdaQueryWrapper<TTask> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(TTask::getSystemId, systemId).eq(TTask::getIsValid,"Y");
        return list(lambdaQueryWrapper);
    }

    @Override
    public List<TTask> queryAllTask() {
        LambdaQueryWrapper<TTask> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.isNotNull(TTask::getSystemId).eq(TTask::getIsValid,"Y");
        return list(lambdaQueryWrapper);
    }
}

